import { createStore } from "vuex"

// 创建一个新的 store 实例
const store = createStore({
    state() {
        return {
            count: 0,
            index: 1,
            age: 18,
            personNum:1,
            fingerPer:10,
            footerPer:10
        };
    },
    mutations: {
        increment(state) {
            state.personNum++;
        },
    },
    getters:{
        totalFinger(state){
            return state.fingerPer * state.personNum
        },
        fingerAndFooter(state,getters){
            return state.footerPer * state.personNum + getters.totalFinger
        }
    }
});

export default store